home *** CD-ROM | disk | FTP | other *** search
/ PC Home 49 / PC_Home_Issue_49.iso / lldemo / lldemo.shr / ROSETTA.EXE / ROSETTA.DXR / 00582_challenge scripts.ls < prev    next >
Encoding:
Text File  |  1996-06-24  |  3.7 KB  |  129 lines

  1. on clickChallenge
  2.   global gPage, gChallengeIndex, gChallengeOrder, gCurQuad, gBlindfold, gPathList, gScreenMode
  3.   highlightChalSpeaker()
  4.   if gBlindfold then
  5.     hideAllResponses()
  6.     drawChallenge()
  7.   end if
  8.   set index to value(char gChallengeIndex of gChallengeOrder)
  9.   if getaProp(gScreenMode, #PCTCHAL) <> #NONE then
  10.     set base to getQuadBase(gCurQuad)
  11.     setChallengePict(base + index - 1)
  12.   end if
  13.   if getaProp(gScreenMode, #SNDCHAL) <> #NONE then
  14.     set index to index + ((gPage - 1) * 4)
  15.     set fname to makeImagePath(gPathList, #sound, index)
  16.     sound playFile 1, fname
  17.   end if
  18.   if getaProp(gScreenMode, #TXTCHAL) = #ONPCT then
  19.     setChallengeText()
  20.   end if
  21.   updateStage()
  22.   if getaProp(gScreenMode, #SNDCHAL) = #NONE then
  23.     if gBlindfold then
  24.       set theWait to the ticks + 120
  25.       if getaProp(gScreenMode, #TXTCHAL) <> #NONE then
  26.         set w to the ticks + (length(the text of cast (344 + index)) * 5.40000000000000036)
  27.         if w > theWait then
  28.           set theWait to w
  29.         end if
  30.       end if
  31.       updateStage()
  32.       repeat while the ticks < theWait
  33.       end repeat
  34.     end if
  35.   end if
  36.   if the stillDown then
  37.     repeat while the stillDown
  38.     end repeat
  39.   end if
  40.   repeat while soundBusy(1) and not (the mouseDown)
  41.   end repeat
  42.   unhighlightChalSpeaker()
  43.   if gBlindfold then
  44.     hideChallenge()
  45.     drawAllResponses()
  46.   end if
  47. end
  48.  
  49. on giveChallenge
  50.   global gPage, gChallengeIndex, gChallengeOrder, gBlindfold, gPathList, gScreenMode, gHasPressed
  51.   stopMouseTrap()
  52.   set gHasPressed to 0
  53.   if inChallenge() then
  54.     if (getaProp(gScreenMode, #SNDCHAL) <> #NONE) or (gBlindfold = 1) then
  55.       highlightChalSpeaker()
  56.       updateStage()
  57.     end if
  58.     if gHasPressed = 0 then
  59.       set index to value(char gChallengeIndex of gChallengeOrder) + ((gPage - 1) * 4)
  60.       if getaProp(gScreenMode, #TXTCHAL) = #ONPCT then
  61.         setChallengeText()
  62.       end if
  63.       if getaProp(gScreenMode, #SNDCHAL) = #NONE then
  64.         if gBlindfold then
  65.           set theWait to the ticks + 120
  66.           if getaProp(gScreenMode, #TXTCHAL) <> #NONE then
  67.             set w to the ticks + (length(the text of cast (344 + index)) * 5.40000000000000036)
  68.             if w > theWait then
  69.               set theWait to w
  70.             end if
  71.           end if
  72.           updateStage()
  73.           if gHasPressed = 0 then
  74.             repeat while (the ticks < theWait) and not (the mouseDown) and not gHasPressed
  75.             end repeat
  76.           end if
  77.         end if
  78.       else
  79.         set fname to makeImagePath(gPathList, #sound, index)
  80.         sound playFile 1, fname
  81.         updateStage()
  82.         repeat while soundBusy(1) and not (the mouseDown) and not gHasPressed
  83.         end repeat
  84.       end if
  85.     end if
  86.     if (getaProp(gScreenMode, #SNDCHAL) <> #NONE) or (gBlindfold = 1) then
  87.       unhighlightChalSpeaker()
  88.     end if
  89.     updateStage()
  90.   end if
  91. end
  92.  
  93. on drawChallenge
  94.   global gChallengeIndex, gChallengeOrder, gScreenMode, gCurQuad, gBlindfold
  95.   set base to getQuadBase(gCurQuad)
  96.   set index to value(char gChallengeIndex of gChallengeOrder)
  97.   if getaProp(gScreenMode, #TXTCHAL) = #ONPCT then
  98.     setChalPict(base + index - 1)
  99.   else
  100.     if getaProp(gScreenMode, #TXTCHAL) = #top then
  101.       if gBlindfold or (getaProp(gScreenMode, #SNDCHAL) = #UPLEFT) then
  102.         showCTextPuppet(45)
  103.       else
  104.         showCTextPuppet(5)
  105.       end if
  106.     end if
  107.   end if
  108.   if getaProp(gScreenMode, #PCTCHAL) = #YES then
  109.     setChallengePict(base + index - 1)
  110.   end if
  111.   updateStage()
  112. end
  113.  
  114. on hideChallenge
  115.   global gScreenMode
  116.   if getaProp(gScreenMode, #TXTCHAL) = #ONPCT then
  117.     setChalPict(341)
  118.     hide9()
  119.   else
  120.     if getaProp(gScreenMode, #TXTCHAL) = #top then
  121.       hide7()
  122.     end if
  123.   end if
  124.   if getaProp(gScreenMode, #PCTCHAL) = #YES then
  125.     setChallengePict(341)
  126.   end if
  127.   updateStage()
  128. end
  129.